<template>
  <div>
    <ul>
      <li v-for="item in messageList" :key="item.id">
        <!--跳转路由并携带query参数，to的字符串写满-->
<!--                <router-link :to="`/home/H_message/H_M_Detail/${item.id}/${item.title}`">-->
<!--                  {{item.id}}-&#45;&#45;{{item.title}}</router-link>-->

        <!--跳转路由并携带query参数，to的对象写法-->
        <router-link :to="{
          name:'详细信息',
          query:{
            id:item.id,
            title:item.title
          }
        }">
          {{ item.id }}---{{ item.title }}
        </router-link>
      </li>
    </ul>
    <hr>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: "H_message",
  data() {
    return {
      messageList: [
        {id: "001", title: "信息1"},
        {id: "002", title: "信息2"},
        {id: "003", title: "信息3"},
        {id: "004", title: "信息4"}
      ]
    }
  },
}
</script>

<style scoped>

</style>